package parser;
import java.util.*;
import java.io.*; 
import antlr.RecognitionException;
import antlr.Token;

public class MakeClass extends Expr {
    
    MakeClass(int name, List<Expr> supers, Stmt suite) {
        this.name = name;
        this.supers = new Tuple(supers);
        this.suite = suite;
    }
    
    int name;
    Tuple supers;
    Stmt suite;
    
    void write(ByteStream out) throws RecognitionException {
        out.write(Opcodes.NEW_SCOPE);
        suite.write(out);
        out.write(Opcodes.POP_SCOPE);
        supers.write(out);
        out.write(Opcodes.MAKE_CLASS);
        out.writeShort(name);
    }
    
    
    void writeLHS(ByteStream out) throws RecognitionException {
        // Shouldn't get here protected by lhs()?
        throw new RecognitionException("Cannot assign to None");
    }
     
    void delete(ByteStream out) throws RecognitionException {
        // Shouldn't get here protected by lhs()?
        throw new RecognitionException("Cannot delete None");
    }
   
    void lhs() throws RecognitionException {
        throw new RecognitionException("Cannot assign to None");
    }
}
